package tier2;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

import tier3.ServicePersistanceService;
import tier3.ServicePersistance;



public class ServeurGestion {


	public static void main(String [] args) throws Exception
	{

		/**SOAP**/
	//	ServicePersistanceService servicePersistance = new ServicePersistanceService();
	//	ServicePersistance port = servicePersistance.getServicePersistancePort();
		//ServiceGestionImpl serv = new ServiceGestionImpl(port);

		/**RMI**/	 
		Registry registry;
		
		
		ServiceGestion stub;
		ServiceGestionImpl service;

		System.setProperty("java.rmi.server.hostname","localhost");

		service = new ServiceGestionImpl();

		stub = (ServiceGestion) UnicastRemoteObject.exportObject(service,0);

		registry = LocateRegistry.createRegistry(2000);  
		registry.bind("ServiceGestion", stub);

		System.out.println("Service enregistre");
	}



}
